import { WebPlugin } from '@capacitor/core';
import { PluginsDemoPlugin } from './definitions';

export class PluginsDemoWeb extends WebPlugin implements PluginsDemoPlugin {
  constructor() {
    super({
      name: 'PluginsDemo',
      platforms: ['web'],
    });
  }
  async getAppList(): Promise<{ result: any; }> {
    return  {
      result: "web is not this method"
    }
  }
  async checkPackExits(options: { packName: string; }): Promise<{ reslut: string | boolean; }> {
    return {
      reslut: "web is not checkPackExits method" + options.packName
    }
  }
  async exitApp(): Promise<{ result: string | boolean; }> {
    return {
      result: 'web is not exitApp method'
    }
  }
  async openUrl(options: { url: string }): Promise<{ complete: string | boolean; }> {
    return {
      complete: 'web is not openUrl method' + JSON.stringify(options.url)
    }
  }

  async echo(options: { value: string }): Promise<{ value: string }> {
    console.log('ECHO', options);
    return options;
  }
}

const PluginsDemo = new PluginsDemoWeb();

export { PluginsDemo };

import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(PluginsDemo);
